//
//  main.cpp
//  封装map和set
//
//  Created by 卜绎皓 on 2022/11/17.
//

#include "RedBlackTree.hpp"
#include "my_map.hpp"
#include "my_set.hpp"
 
 
int main()
{
    Bernard::map<int, int> m;
    m.insert(make_pair(1, 1));
    m.insert(make_pair(3, 3));
    m.insert(make_pair(0, 0));
    m.insert(make_pair(9, 9));
 
    Bernard::map<int, int>::iterator it = m.begin();
    while (it != m.end())
    {
        cout << (*it).first << ":" << (*it).second << endl;
        cout << it->first << ":" << it->second << endl;
        ++it;
    }
 
    Bernard::set<int> s;
    s.insert(1);
    s.insert(5);
    s.insert(2);
    s.insert(1);
    s.insert(13);
    s.insert(0);
    s.insert(15);
    s.insert(18);
 
    Bernard::set<int>::iterator sit = s.begin();
    while (sit != s.end())
    {
        cout << *sit << " ";
        ++sit;
    }
    cout << endl;
    return 0;
}
